package com.sibu.yx.promotion.service.impl.sys;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.doubo.common.model.response.CommonResponse;
import com.sibu.yx.promotion.common.manage.ResponseManage;
import com.sibu.yx.promotion.persistence.model.sys.SysUser;
import com.sibu.yx.promotion.persistence.mapper.SysUserMapper;
import com.sibu.yx.promotion.service.sys.SysUserService;


/**
 * @author yuwenbo
 * @create 2019-04-03 15:42
 **/
@Service
public class SysUserServiceImpl implements SysUserService {

    @Autowired
    private SysUserMapper sysUserMapper;


    @Override
    public CommonResponse<SysUser> selectUser(String userName) {
        SysUser sysUser = sysUserMapper.selectByUserName(userName);
        return ResponseManage.successIfNotNull(sysUser);
    }

    @Override
    public CommonResponse<SysUser> selectUserById(String id) {
        SysUser sysUser = sysUserMapper.selectByPrimaryKey(Long.valueOf(id));
        return ResponseManage.successIfNotNull(sysUser);
    }
}
